<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta content="email=no" name="format-detection"/>
    <meta content="telephone=no" name="format-detection" />
    <link href="__PUBLIC__/css/layout.css" type="text/css" rel="stylesheet" >
    <script src="__PUBLIC__/js/jquery-1.10.1.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/iscroll-probe.js"></script>
    <script type="text/javascript" src="/Public/js/search_list.js"></script>
</head>
<body onload="loaded();">
<div class="head">
    <div class="head-cont"><a href="javascript:history.back();" ><i class="icon-iconfont-fanhui1"></i></a> <span class="head-tit" id="header_value" data-value="{$value}">{$value}</span> </div>
</div>
<div class="page-ff">
    <div class="h45"></div>
    <div class="pro-nav" style="position: fixed;">
        <span class="pro-navspan">所有分类
            <span class="pro-navspan-xian"></span>
            <span class="pro-arrow pro-arrow-down"></span>
        </span>
        <span  class="pro-navspan">默认排序
            <span class="pro-arrow pro-arrow-down"></span>
        </span>
        <div class="pro-navcon" id="filter_list">
            <a href="javascript:void(0);" data-filter="nothing">所有分类</a>
            <a href="javascript:void(0);" data-filter="yibao_drug">医保药</a>
            <a href="javascript:void(0);" data-filter="RX">处方药</a>
            <a href="javascript:void(0);" data-filter="OTC">非处方药</a>
            <a href="javascript:void(0);" data-filter="zhongyao">中药</a>
            <a href="javascript:void(0);" data-filter="xiyao">西药</a>
            <input type="hidden" value="{$filter}" id="filter">
        </div>
        <div class="pro-navcon" id="sort_list">
            <a href="javascript:void(0);" data-sort="score">默认排序</a>
            <a href="javascript:void(0);" data-sort="score">好评优先</a>
            <a href="javascript:void(0);" data-sort="comment">人气优先</a>
            <a href="javascript:void(0);" data-sort="price">价格从高到低</a>
            <a href="javascript:void(0);" data-sort="price">价格从低到高</a>
            <input type="hidden" value="{$sort_type}" id="sort_type">
            <input type="hidden" value="{$order_type}" id="order_type">
        </div>
    </div>
    <div style="clear: both"></div>
<div class="pro-cons" id="wrapper">
    <div id="scroller">
        <div class="pullDown">
            <span class="pullDownLabel">向下拖动显示最新结果</span>
        </div>
         <ul id="list_info">
            <php>foreach($search as $k => $v){</php>
             <li>
                <a href="/drug/{$v['objectId']}">
                <php>if(empty($v['images']['thumb'])){</php>
                <img src="__PUBLIC__/images/no_drug_image.jpg" class="pro-img">
                <php>}else{</php>
                <img src="{$v['images']['thumb'][0]}" class="pro-img">
                <php>}</php>
                <p class="pro-deso">
                        <span class="pro-tit">
                            <span class="pro-bs">
                                <span class="pro-bs0 pro-bs1">RX</span>
                                <span class="pro-bs0 pro-bs2">基</span>
                                <span class="pro-bs0 pro-bs3">医保</span>
                                <span class="pro-bs0 pro-bs4">西药</span>
                            </span>{$v['product_name']}</span>
                        <span class="pro-star">
                            <php>for($i = 0; $i < intval($v['score']); $i++){
                                echo '<i class="icon-iconfont-star1"></i>';
                                }</php>
                            <php>for($j = 0; $j < 5 - intval($v['score']); $j++){
                                echo '<i class="icon-iconfont-star2"></i>';
                                }</php>{$v['score']}分</span>
                        <span class="pro-info">
                            <span class="pro-infof">{$v['price']['market']}
                            </span>{$v['instructions']['生产企业']}
                        </span>
                </p>
                </a>
             </li>
            </a>
             <php>}</php>
            <li style="text-align: center;" id="last_load_li">加载更多...</li>
         </ul>
        <div class="pullUp"></div>
    </div>
</div>
    <div class="h45"></div>
</div>
<div class="pro-foot"><span class="pro-con"></span>对比</span></div>
<script type="text/javascript">
    $(document).ready(function(){
        $('.pro-navspan').click(function(){
            var index = $(this).index();
            $('.pro-navcon').eq(index).toggle();
            $('.pro-navcon').eq(1-index).hide();
            var arrow=$(this).children('.pro-arrow');
            if(arrow.hasClass("pro-arrow-down")){
                $(this).addClass('pro-navspan-slt');
                arrow.removeClass("pro-arrow-down");
                arrow.addClass("pro-arrow-up");
            }else if(arrow.hasClass("pro-arrow-up")){
                $(this).removeClass('pro-navspan-slt');
                arrow.removeClass("pro-arrow-up");
                arrow.addClass("pro-arrow-down");
            }
        });

        $('#filter_list a').click(function(){
            $('#filter').val($(this).attr("data-filter"));
            $("#list_info").empty();
            loadInfo($("#list_info"),1);
            $(this).parent('.pro-navcon').removeClass('pro-navspan-slt').toggle();
        });

        $('#sort_list a').click(function(){
            var index = $(this).index();
            $("#list_info").empty();
            $('sort_type').val($(this).attr('data-sort'));
            if(index == 4 || index == 3){
                if(index == 3) {
                    $('order_type').val('-1');
                }else{
                    $('order_type').val('1');
                }
            }
            loadInfo($("#list_info"),1);
            $(this).parent('.pro-navcon').removeClass('pro-navspan-slt').toggle();
        })
    });
</script>
</body>
</html>
